class ShortInputError(Exception):

    def __init__(self, length, min_len):
        super().__init__()
        self.length = length
        self.min_len = min_len

    def __str__(self):
        return f'输入长度{self.length}, 不能少于{self.min_len}个字符'


def main(min_len: int):
    password = input('请输入密码：')
    length = len(password)
    try:
        if length < min_len:
            raise ShortInputError(length, min_len)
    except Exception as e:
        print(e)
    else:
        print('密码输入完成')


if __name__ == '__main__':
    main(6)
